package com.qd.panda.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.cdqidi.config.mybatis.handler.GeoPoint;
import com.cdqidi.config.mybatis.handler.GeoPointHandler;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 停车场位置信息
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName(value = "panda_car_park_location",autoResultMap = true)
public class CarParkLocation extends Model<CarParkLocation> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "p_id", type = IdType.ASSIGN_ID)
    private String pId;
    /**
     * 地址
     */
    @TableField("address")
    private String address;
    /**
     * 纬度
     */
    @TableField("lat")
    private BigDecimal lat;
    /**
     * 经度
     */
    @TableField("lng")
    private BigDecimal lng;
    /**
     * 行政区划代码:行政区划代码
     */
    @TableField("ad_code")
    private String adCode;
    /**
     * 位置类型:5腾讯地图 3百度地图
     */
    @TableField("location_type")
    private Integer locationType;
    /**
     * 所在地区编码
     */
    @TableField("region")
    private String region;
    /**
     * 所在地区名称
     */
    @TableField("region_name")
    private String regionName;
    /**
     * 省编码
     */
    @TableField("province_id")
    private String provinceId;
    /**
     * 省名称
     */
    @TableField("province_name")
    private String provinceName;
    /**
     * 市编号
     */
    @TableField("city_id")
    private String cityId;
    /**
     * 市名称
     */
    @TableField("city_name")
    private String cityName;

    @TableField(value = "location",typeHandler = GeoPointHandler.class)
    private GeoPoint location;

    public void freeData() {
        this.pId = null;
        this.address = null;
        this.lat = null;
        this.lng = null;
        this.adCode = null;
        this.locationType = null;
        this.region = null;
        this.regionName = null;
        this.provinceId = null;
        this.provinceName = null;
        this.cityId = null;
        this.cityName = null;
    }
}
